﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Data;

namespace ltModel.BLL
{
    /// <summary>
    /// 
    /// </summary>
    public class ProjectBLL
    {
        private readonly ltModel.DAL.ProjectDAL dal = new ltModel.DAL.ProjectDAL();
        public ProjectBLL()
        { }
        #region  Public Mothods

        /// <summary>
        /// Add a project
        /// </summary>
        public int Add(ltModel.Model.Project model)
        {
            return dal.Add(model);
        }

        /// <summary>
        /// Upodate a project
        /// </summary>
        public bool Update(ltModel.Model.Project model)
        {
            return dal.Update(model);
        }

        /// <summary>
        /// Delete a project by id
        /// </summary>
        public bool Delete(int id)
        {
            return dal.Delete(id);
        }

        /// <summary>
        /// Get project by id
        /// </summary>
        public ltModel.Model.Project GetModel(int id)
        {
            return dal.GetModel(id);
        }

        /// <summary>
        /// Get project list
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }
        /// <summary>
        /// Get project list by limit
        /// <param name="TopNum">limit</param>
        /// <param name="strWhere">condition</param>
        /// </summary>
        public DataSet GetList(string TopNum, string strWhere)
        {
            return dal.GetList(TopNum, strWhere);
        }

        /// <summary>
        /// Get all projects
        /// </summary>
        public DataSet GetAllList()
        {
            return dal.GetList(string.Empty);
        }

        /// <summary>
        /// Update project status.
        /// </summary>
        /// <param name="projectID"></param>
        /// <param name="approved"></param>
        /// <returns></returns>
        public bool UpdateStatus(string projectIDs, string approved)
        {
            return dal.UpdateStatus(projectIDs, approved);
        }

        #endregion

    }
}